package io.openkunlun.javadsl.springboot.server;

import io.openkunlun.javadsl.server.FailureDetector;
import org.springframework.beans.factory.config.BeanDefinition;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Role;

@Configuration
@Role(BeanDefinition.ROLE_INFRASTRUCTURE)
public class DaprFailureDetectorRegistrar {

    @Bean(name = "daprFailureDetector")
    @ConditionalOnMissingBean
    FailureDetector failureDetector() {
        return FailureDetector.AVAILABLE;
    }
}
